<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lesson 22</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id="root"></div>
</body>

</html>
<script>
    //  v-once：让某个元素标签之渲染一次
    // ref：实际上获取 DOM 节点 / 组件引用的一个语法
    // provide /  inject
    const app = Vue.createApp({
        data() {
            return {
                count: 1
            };
        },
        provide() {
            return {
                count: this.count
            }
        },
        template: `
        <div>
                <child :count="count" />
                <button @click="count++">Add</button>
        </div>
        `
    });

    const vm = app.mount("#root")
</script>